﻿////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// <copyright>Copyright 2008-2011 Andreas Huber Doenni</copyright>
// Distributed under the GNU General Public License version 2 (GPLv2).
// See accompanying file License.txt or copy at http://phuse.codeplex.com/license.
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

namespace Phuse.Net.Nntp
{
    using System.Diagnostics.CodeAnalysis;

    /// <summary>Represents the response to a <see cref="GroupCommand"/>.</summary>
    /// <threadsafety static="true" instance="false"/>
    public sealed class GroupResponse : Response<GroupResponse>
    {
        private readonly long articleCount;
        private readonly long lowWaterMark;
        private readonly long highWaterMark;
        private readonly string groupName;

        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////

        /// <summary>Gets the estimated number of articles in the group.</summary>
        public long ArticleCount
        {
            get { return this.articleCount; }
        }

        /// <summary>Gets the reported low water mark.</summary>
        [SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "WaterMark", Justification = "This is not a watermark.")]
        public long LowWaterMark
        {
            get { return this.lowWaterMark; }
        }

        /// <summary>Gets the reported high water mark.</summary>
        [SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "WaterMark", Justification = "This is not a watermark.")]
        public long HighWaterMark
        {
            get { return this.highWaterMark; }
        }

        /// <summary>Gets the name of the newsgroup.</summary>
        public string GroupName
        {
            get { return this.groupName; }
        }

        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////

        internal GroupResponse(long articleCount, long lowWaterMark, long highWaterMark, string groupName)
        {
            this.articleCount = articleCount;
            this.lowWaterMark = lowWaterMark;
            this.highWaterMark = highWaterMark;
            this.groupName = groupName;
        }
    }
}
